//订单查询
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            showStoreOrderExpressInfo: {
                orderId:'',
                express: []
            }
        },
        _initMethod: function () {

        },
        _initEvent: function () {
            vc.on('showStoreOrderExpress', 'openExpressModel', function (_param) {
                $that.clearSendStoreOrderCart();
                vc.copyObject(_param, $that.showStoreOrderExpressInfo);
                $that._loadStoreOrderExpress();
                $("#showStoreOrderExpressModal").modal('show');
            });
        },
        methods: {
            _loadStoreOrderExpress: function () { //发货方法
                let param = {
                    params: {
                        page: 1,
                        row: 100,
                        orderId: $that.showStoreOrderExpressInfo.orderId,
                        shopId:vc.getCurrentCommunity().shopId
                    }
                };
                //发送get请求
                vc.http.apiGet('/storeOrder.queryLogisticsDetail',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        $that.showStoreOrderExpressInfo.express = _json.data;
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            clearSendStoreOrderCart: function () {
                $that.showStoreOrderExpressInfo = {
                    orderId:'',
                    express: []
                }
            },
            _closeStoreOrderExpressModal: function () {
                $("#showStoreOrderExpressModal").modal('hide');
            },
        }
    });
})(window.vc);